package _33define;

public class Demo4 {
    public static void main(String[] args) {
        int[] nums= {2, 7, 11, 15};
        int target=9;
        for (int i = 0; i < nums.length; i++) {
            if (i==(nums.length-1)){
                break;
            }
            for (int j = i+1; j < nums.length; j++) {
                if ((nums[i]+nums[j])==target){
                    System.out.println("["+i+","+j+"]");
                }
            }
        }
    }
}
